<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <include file="Public:jquery" />
        <include file="Public:dialog" />
        <include file="Public:startapp" />
        <include file="Public:startmoo" />
        <script type="text/javascript">
            $(function(){
                
                $('#add_model').click(function(){
					var $add_action = art.dialog({
						title : $(this).text(),
						lock : true
					});
					var pid = '{$_GET["pid"]}';
					if (pid != ''){
						var url = "__URL__/add/pid/"+pid;
					}else{
						var url = "__URL__/add/pid/0";
					}
					$.ajax({
						url : url,
						success : function(data){
							$add_action.content(data);
							submitstyle();
						},
						cache : false
					});
					
					return false;
				});
				
				$('.edit_model').click(function(){
					var url = $(this).attr('href');
					var edit_model = art.dialog({
						title : $(this).text(),
						lock : true
					});
					$.ajax({
						url : url,
						success : function(data){
							edit_model.content(data);
							submitstyle();
						},
						cache : false
					});
					return false;
				});
				
				$('.del_node').click(function(){
					var del_url = $(this).attr('href');
					$.ajax({
						url : "__URL__/checkDelete/id/" + $(this).attr('rel'),
						dataType : "json",
						success : function(data){
							if (data.status == 0){
								art.dialog({
									content : data.info,
									lock : true
								});
							}else{
								art.dialog({
									content : '确定删除吗？',
									ok : function(){
										window.location.href = del_url;
									},
									cancel : true,
									lock : true
								});
							}
						},
						cache : false
					});
					return false;
				});
            });
        </script>
    </head>
    <body>
        <include file="Public:header" />
        
        <div class="layout">
            
            <include file="Public:position" />
            
            <table class="warp" cellpadding="0" cellspacing="0">
                <tr>
                    <td class="sidebar" valign="top">
                        <include file="Public:sidebar" />
                    </td>
                    <td class="contents" valign="top">
                        
	                    <div class="button">
                            <a href="javascript:void(0);" class="default_button" id="add_model"><span></span>新增节点</a>
                        </div>
                                              
                        <div class="a_table">
	                        <table cellspacing="1" width="100%" class="gr_list">
								<tr style="background: #f0f7ff; font-weight: bold;">
									<td width="20" height="20"></td>
									<td width="60" align="center">编号</td>
									<td width="100" align="center">名称</td>
									<td align="center">显示名</td>
									<td width="100" align="center">分组</td>
									<td width="100" align="center">状态</td>
									<td width="160" align="center">操作</td>
								</tr>
								<volist id="vo" name="list">
								<tr rel="{$vo['id']}">
									<td><input type="checkbox" name="list[]" value="{$vo.id}" /></td>
									<td align="center">{$vo['id']}</td>
									<td align="center"><a href="{:U('index?pid='.$vo['id'].'&tag='.$_GET['tag'])}">{$vo['name']}</a></td>
									<td align="center">{$vo['title']}</td>
									<td align="center">{$vo['group_id']|getNodeGroupName}</td>
									<td align="center">{$vo['status']|getStatus}</td>
									<td align="center">
										{$vo['status']|showStatus=$vo['id'],'navTabAjaxMenu'}<span class="action_line">&nbsp;&nbsp;|&nbsp;&nbsp;</span><a href="{:U('edit?id='.$vo['id'].'&gid='.$vo['group_id'])}" class="edit_model">编辑</a><span class="action_line">&nbsp;&nbsp;|&nbsp;&nbsp;</span><a href="{:U('delete?id='.$vo['id'])}" class="del_node" rel="{$vo.id}">删除</a>
									</td>
								</tr>
								</volist>
							</table>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        
        <include file="Public:footer" />
    </body>
</html>